package com.ruoyi.hisDoor.service.impl;


import com.ruoyi.data.DataUtils;
import com.ruoyi.door.domain.HouseDoorT;
import com.ruoyi.hisDoor.domain.HouseHisDoorT;
import com.ruoyi.hisDoor.mapper.HouseHisDoorMapper;
import com.ruoyi.hisDoor.service.IHouseHisDoorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 收费标准Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-09
 */
@Service
public class HouseHisDoorServiceImpl implements IHouseHisDoorService
{

    @Autowired
    private HouseHisDoorMapper houseHisDoorMapper;
    /**
     * 修改户管理
     *
     * @param houseDoorT 户管理
     * @return 结果
     */
    @Transactional
    @Override
    public int updateHouseHisDoorT(HouseDoorT houseDoorT)
    {
        HouseDoorT doorTempVO = new HouseDoorT();
        HouseHisDoorT houseHisDoorT = new HouseHisDoorT();
        houseDoorT.setBalance(houseDoorT.getBudgetMoney());
        houseDoorT.setCostMoney(houseDoorT.getBudgetMoney());
        int costId = houseHisDoorMapper.getCostId();
        houseHisDoorT.setSerial(String.valueOf(costId+1));
        houseHisDoorT.setCostDate(houseDoorT.getCostDate());
        houseHisDoorT.setCreater(houseDoorT.getCreater());
        houseHisDoorT.setRemark(houseDoorT.getRemark());
        houseHisDoorT.setHouseId(houseDoorT.getHouseId());
        houseHisDoorT.setCostBillType(houseDoorT.getCostBillType());
        houseHisDoorT.setCostBillWay(houseDoorT.getCostBillWay());
        houseHisDoorT.setCostMoney(houseDoorT.getBudgetMoney());
        houseHisDoorMapper.insertHouseCostT(houseHisDoorT);
        houseHisDoorMapper.updateHouseDoorT(houseDoorT);
        return costId;
    }
}
